package edu.istu.asu07_1.live.model;

import java.util.List;
import java.util.Random;

import edu.istu.asu07_1.live.configs.Constants;
import edu.istu.asu07_1.live.model.agents.Agent;

public class AgentLocationCreator {

	private List<Agent> agentsList;
	private Random rnd;

	public AgentLocationCreator(List<Agent> agentsList){
		this.agentsList = agentsList;
		rnd = new Random();
	}

	public void placeAgent(int strategy){
		switch(strategy){
			case PLACE_RANDOM:
				for(int i=0; i<agentsList.size(); i++){
					Agent a = agentsList.get(i);
					a.setxCoord(rnd.nextInt(Constants.FIELD_WIDTH-1)+1);
					a.setyCoord(rnd.nextInt(Constants.FIELD_HEIGHT-1)+1);
					a.setMoveDirection(rnd.nextInt(3));
				}
				break;
		}
	}

	public static final int PLACE_BY_GROUP = 0;
	public static final int PLACE_RANDOM = 1;
}
